\section{Introduction}
\label{sec:introduction}

Nowadays, managing software systems at runtime becomes a hot topic both in academia and industry. On the one hand, many of the mainstream platforms provide some form of management capabilities to enable external management agents (either human administrator or software-based agents) to monitor and control it at runtime. On the other hand, on the research of different forms of management activities, such as human-directed runtime evolution or automatic self-adaptation, self-management, etc. many researchers are considering abstracting the system states into some kind of models, especially architectural models. Architectural models shield out the complex and technical details, and provide a abstract and usually domain-specific view of the running system states. Management agents can monitor and control the systems by reading and writing their architectural model in proper forms.

There are many research approaches relevant to runtime architectures, focusing on different issues, but one issues is unavoidable for all these approaches, i.e. how to make sure the architectural model reflects the current system states and in the mean time the system states will be changed correctly according the architectural changes. Some researcher name this issue as ``maintaining the connection between architectural model and system states'', and name the particular parts in their approaches for maintain causal connections as ``runtime architecture infrastructures''. We follow these two name in the rest of this paper to simplify the discussion. Although it is not the main concern for all the approaches mentioned above, researchers of all these approaches did propose different but effective mechanisms for maintaining causal connections, and implement corresponding infrastructures, specific to the kinds of architecture models and running systems they chose. 

Only individual infrastructures are not enough. There are many different kinds of running systems with different management capabilities, and there are also many architecture models, fitting for different domains and management capabilities. If a developer wants to provide a proper kind of architectural models for managing a specific kind of running system, she usually has to first put much effort on implementing an infrastructure to connect the architecture and the system, even if this is not her main concern. And moreover, these particularly constructed infrastructures are often inevitable to have some kinds of little defects, and are often not easy for maintenance. Having noticed this problem, some researchers begin to consider a framework for constructing such software architecture infrastructures. 

Existing frameworks, as far as we know, still have some limitations. The authors of Rainbow summarized a common structure of architecture-based self-adaptable systems, and identified the reusable parts, but they did not provide a mature and common support for constructing all these parts; In their succeeding work, they provide a high-level language for specifying the relation between system and architecture, along with an engine to execute this language, but their language and engine are unidirectional, which cannot propagate the architecture change into running system; Genie supports a model-based approach for developing self-adaptive systems, but the currently this tool is specific to one kind of running systems, i.e. the systems running upon the Gridkit reflective middleware platform.

In this paper, we report our initial attempt towards a framework to support constructing runtime architecture infrastructures in a model-driven approach. By utilizing bidirectional transformation and model compare in a well-designed process, we support the maintaining of causal connections in both directions. And moreover, by utilizing the standard model-driven techniques of MOF, QVT and code generation, our framework can be used between different kinds of architectures and systems, in a unified way. 


The advantages of our framework can be summarized as follows.

\begin{itemize}
	\item
	Our framework can improve the productivity for constructing runtime architecture infrastructures. The only work required for developers is using standard languages to specify the architecture style, the system's management capability, and the relation between them, and fill some simple hook methods in the generated code schema with the specific logic for accessing the management capability. The most difficult issue, i.e. how to maintain the causal connection according to these specifications, is transparent to developers.	We will demonstrate the improvement on productivity in our cased study. 
	\item
	The behavior of the obtained infrastructures is clear, predictable, and stable. For a constructed infrastructure, the architecture style, the system management capability and consistency relation between them are all specified explicitly, under formal and standardized languages, and we also prove that our framework preserve some key properties between these specifications. This makes our framework good for maintenance and incremental development.  
	\item
	We separate the development of software architecture infrastructures into three relatively independent concerns. When a developer is in charge of specifying the system states, he or she does not need to care about the architecture and the relation. This makes the specification of one kind of systems, along with the filled hook methods, reusable for different architecture styles. It is also the case for architectural sides. 
	
\end{itemize}